package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestGrab;
import com.estar.assistsurvy.entity.ResponseMsg;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class GrabOrderThread extends BaseThread {

	private RequestGrab requestGrab;

	public GrabOrderThread(Context context, Handler handler, RequestGrab requestGrab) {
		super(context, handler);
		this.requestGrab = requestGrab;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.GRAB_CONFIRM;
		json=gson.toJson(requestGrab);
		postRequest(url_str, json);
		if(result!=null){
			Log.i("wl", "抢单返回参数"+result);
			ResponseMsg confirm=new ResponseMsg();
			confirm=gson.fromJson(result, ResponseMsg.class);
			msg.what=1;
			msg.obj=confirm;
			msg.sendToTarget();
		}
	}
}
